from typing import Dict, Type

from engine_server.config.base import IConfig
from engine_server.core.base_collector import Collector
from engine_server.core.vllm.vllm_collector import VLLMCollector


class CollectorFactory:
    def __init__(self):
        self._collector_map:Dict[str,Type[Collector]] = {
            "vllm" : VLLMCollector
        }

    def create_collector(self, config: IConfig) -> Collector:
        config_type = config.get_server_config().engine_type
        collector_class = self._collector_map.get(config_type)

        if not collector_class:
            raise ValueError(f"No collector found for config type {config_type}")

        return collector_class(config)
